import { apiClient } from './client';
import { API_ENDPOINTS } from './config';
import type { WithdrawListParams, WithdrawListResponse, WithdrawFormData } from '../../types/withdraw';

export const withdrawApi = {
  // Get withdraw list
  getList: async (params: WithdrawListParams): Promise<WithdrawListResponse> => {
    return apiClient.get(API_ENDPOINTS.AMOUNT.WITHDRAW_LIST, { params });
  },

  // Submit withdraw request
  withdraw: async (data: WithdrawFormData) => {
    return apiClient.post(API_ENDPOINTS.AMOUNT.WITHDRAW, data);
  },

  // Cancel withdraw
  cancel: async (data: { withdrawId: number }) => {
    return apiClient.post(API_ENDPOINTS.AMOUNT.WITHDRAW_CANCEL, data);
  },
};
